package com.leo.apptest.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhangguobao on 16/10/27.
 */
public class Person implements Parcelable {
    private int id;
    private String name;


    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
    }
    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Person> CREATOR = new Creator<Person>() {
        @Override
        public Person createFromParcel(Parcel in) {
            Person p = new Person();
            p.setId(in.readInt());
            p.setName(in.readString());
            return p;
        }

        @Override
        public Person[] newArray(int size) {
            return new Person[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
